package com.frame.common.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 分页请求参数
 *
 * @Author: Flying
 * @Date: 2018/5/24 15:47
 */
@ApiModel("分页请求参数")
@Data
public class ReqPageInfoVO extends ReqUserId {

    @ApiModelProperty(value = "当前页")
    private Integer currentPage = 1;

    @ApiModelProperty(value = "显示的条数")
    private Integer showCount = 10;

    @ApiModelProperty(value = "当前分页的时间戳")
    private Long timeStamp;

    @ApiModelProperty(value = "排序字段",hidden = true)
    private String sortField = "";

    @ApiModelProperty(value = "排序顺序  desc|asc",hidden = true)
    private String sortOrder = "";

    @ApiModelProperty(value="查询开始位置", hidden = true)
    private Integer currentResult;

    public Integer getCurrentResult() {
        // 计算从第几条获取数据
        currentResult = (currentPage - 1) * showCount;
        return currentResult;
    }
}
